<?php

namespace Cake\Controller\Component;

use Cake\Controller\Component;
use Cake\Network\Email\Email;

class EmailComponent extends Component {

    public function sendEmail($variavies, $view, $subject) {
        $email = new Email('default');
        $email->template($view)->emailFormat('html')
                ->to($variavies['emissora']['email_responsavel'])
                ->bcc(['murilo.wlima@gmail.com', 'marloso88@gmail.com'])
                ->subject($subject)
                ->viewVars(['vars' => $variavies])
                ->send();
    }

}
